﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Asion.Dapper
{
    public interface IGroupColumn : ICondition
    {
    }


    public class GroupColumn : BaseCondition, IGroupColumn, IGetSql
    {

        private string condition;

        /// <summary>
        /// single order default asc
        /// </summary>
        /// <param name="field"></param>
        /// <param name="type"></param>
        public GroupColumn(string field)
        {
            condition = field;

        }

        public GroupColumn(string[] fields)
        {
            condition = string.Join(",", fields);

        }

        public override string BuildSql()
        {
            return $" group by {this.condition} ";
        }



    }
}
